class SIGNALS:
    book_parsed='book_parsed'
    chapter_parsed="chapter_parsed"
    pages_parsed='pages_parsed'

class Signal:
    events={}

    @classmethod
    def connect(cls,signal:str,handler):
        handler_list:list= cls.events.setdefault(signal,[])
        handler_list.append(handler)
    
    @classmethod
    def emit(cls,signal,*args,**kwargs)->list:
        handler_list=cls.events.get(signal)
        if not handler_list:
            return
        # results=[]
        for handler in handler_list:
            handler(*args,**kwargs)
        #     results.append(results)
        # return results
